﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace iTeamyou.LTS.Core.Models
{
    /// <summary>
    /// 批次
    /// </summary>
    public class Batch
	{
        /// <summary>
        /// 批次ID
        /// </summary>
        [DisplayName("批次ID")]
        [Description("批次ID")]
        [Required(ErrorMessage = "批次ID不能为空")]
        public string BId { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        [DisplayName("批次号")]
        [Description("批次号")]
        [Required(ErrorMessage = "批次号不能为空")]
        public string Number { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [DisplayName("数量")]
        [Description("数量")]
        [Required(ErrorMessage = "数量不能为空")]
        public int Quantity { get; set; }

        /// <summary>
        /// 店铺ID
        /// </summary>
        [DisplayName("店铺ID")]
        [Description("店铺ID")]
        //[Required(ErrorMessage = "店铺ID不能为空")]
        public string? StoreId { get; set; }

        /// <summary>
        /// 店铺名称
        /// </summary>
        [DisplayName("店铺名称")]
        [Description("店铺名称")]
        //[Required(ErrorMessage = "店铺名称不能为空")]
        public string? StoreName { get; set; }

        /// <summary>
        /// 商品UPC
        /// </summary>
        [DisplayName("UPC")]
        [Description("UPC")]
        [NotMapped]
        public string? ProductUPC { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [DisplayName("商品名称")]
        [Description("商品名称")]
        [NotMapped]
        public string? ProductName { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        [DisplayName("供应商名称")]
        [Description("供应商名称")]
        public string? SupplierName { get; set; }

        /// <summary>
        /// 商品SKU
        /// </summary>
        [DisplayName("SKU")]
        [Description("SKU")]
        [NotMapped]
        public string? ProductSKU { get; set; }

        /// <summary>
        /// 采购订单号
        /// </summary>
        [DisplayName("采购订单号")]
        [Description("采购订单号")]
        [Required(ErrorMessage = "采购订单号不能为空")]
        public string OrderNumber { get; set; }

        /// <summary>
        /// 入库时间
        /// </summary>
        [DisplayName("入库时间")]
        [Description("入库时间")]
        public DateTime? EntryDatetime { get; set; }

        /// <summary>
        /// 入库单号
        /// </summary>
        [DisplayName("入库单号")]
        [Description("入库单号")]
        [Required(ErrorMessage = "入库单号不能为空")]
        public string WarehouseNumber { get; set; }

        /// <summary>
        /// 有效期
        /// </summary>
        [DisplayName("有效期")]
        [Description("有效期")]
        public int? ValidDate { get; set; }

        /// <summary>
        /// 到期日期
        /// </summary>
        [DisplayName("到期日期")]
        [Description("到期日期")]
        public DateTime? DateDue { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        [DisplayName("生产日期")]
        [Description("生产日期")]
        public DateTime? ProducedDate { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DisplayName("创建时间")]
        [Description("创建时间")]
        public DateTime? CreatedOn { get; set; }

        /// <summary>
        /// 创建者
        /// </summary>
        [DisplayName("创建者")]
        [Description("创建者")]
        public string CreatedBy { get; set; }

        /// <summary>
        /// 最近更新时间
        /// </summary>
        [DisplayName("最近更新时间")]
        [Description("最近更新时间")]
        public DateTime? LastModifiedOn { get; set; }

        /// <summary>
        /// 最近更新者
        /// </summary>
        [DisplayName("最近更新者")]
        [Description("最近更新者")]
        public string LastModifiedBy { get; set; }

        /// <summary>
        /// 批次证照
        /// </summary>
        [DisplayName("批次证照")]
        [Description("批次证照")]
        [Required]
        public List<BatchLicense> BatchLicenses { get; set; }

        //[Required]
        public Product Product { get; set; }

        public Supplier Supplier { get; set; }

        /// <summary>
        /// 供应商关联编码
        /// </summary>
        public string? SupplierId { get; set; }

        /// <summary>
        /// 商品关联编码
        /// </summary>
        public string? ProductId { get; set; }

        /// <summary>
        /// 证照数
        /// </summary>
        [DisplayName("证照数")]
        [Description("证照数")]
        public int LicenseNum { get; set; }

        /// <summary>
        /// 系统唯一编号
        /// </summary>
        public string Id { get; set; }
    }

    /// <summary>
    /// 批次导出
    /// </summary>
    public class ExportBatch
    {
        /// <summary>
        /// 批次ID
        /// </summary>
        [DisplayName("批次ID")]
        [Description("批次ID")]
        public string Id { get; set; }

        /// <summary>
        /// 商品SKU
        /// </summary>
        [DisplayName("SKU")]
        [Description("SKU")]
        public string? ProductId { get; set; }

        /// <summary>
        /// 商品UPC
        /// </summary>
        [DisplayName("UPC")]
        [Description("UPC")]
        public string? ProductUPC { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [DisplayName("商品名称")]
        [Description("商品名称")]
        public string? ProductName { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [DisplayName("数量")]
        [Description("数量")]
        public int Quantity { get; set; }

        /// <summary>
        /// 店铺ID
        /// </summary>
        [DisplayName("店铺ID")]
        [Description("店铺ID")]
        public string StoreId { get; set; }

        /// <summary>
        /// 店铺名称
        /// </summary>
        [DisplayName("店铺名称")]
        [Description("店铺名称")]
        public string StoreName { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        [DisplayName("供应商名称")]
        [Description("供应商名称")]
        public string? SupplierName { get; set; }

        /// <summary>
        /// 采购订单号
        /// </summary>
        [DisplayName("采购订单号")]
        [Description("采购订单号")]
        public string OrderNumber { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        [DisplayName("批次号")]
        [Description("批次号")]
        public string Number { get; set; }

        /// <summary>
        /// 入库时间
        /// </summary>
        [DisplayName("入库时间")]
        [Description("入库时间")]
        public DateTime? EntryDatetime { get; set; }

        /// <summary>
        /// 入库单号
        /// </summary>
        [DisplayName("入库单号")]
        [Description("入库单号")]
        public string WarehouseNumber { get; set; }

        /// <summary>
        /// 到期日期
        /// </summary>
        [DisplayName("到期日期")]
        [Description("到期日期")]
        public DateTime? DateDue { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        [DisplayName("生产日期")]
        [Description("生产日期")]
        public DateTime? ProducedDate { get; set; }

        /// <summary>
        /// 商品规格
        /// </summary>
        [DisplayName("商品规格")]
        [Description("商品规格")]
        public string? Specification { get; set; }

        /// <summary>
        /// 商品部类
        /// </summary>
        [DisplayName("商品部类")]
        [Description("商品部类")]
        public string? Department { get; set; }

        /// <summary>
        /// 有效期
        /// </summary>
        [DisplayName("有效期")]
        [Description("有效期")]
        public int? ValidDate { get; set; }

        /// <summary>
        /// 批次证照
        /// </summary>
        [DisplayName("批次证照")]
        [Description("批次证照")]
        [BizDataType("ListURL")]
        public List<string>? BatchLicenseUrl { get; set; }

        /// <summary>
        /// 商品细分类
        /// </summary>
        public string? SectionId { get; set; }

        /// <summary>
        /// 供应商编码
        /// </summary>
        public string? SupplierId { get; set; }

        /// <summary>
        /// 供应商联系方式
        /// </summary>
        public string? SupplierContact { get; set; }
    }
}

